#ifndef VARIABLESVIEWDIALOG_H
#define VARIABLESVIEWDIALOG_H

#include "treeviewmodel.h"

#include <QDialog>
#include <QTreeView>
#include <QStandardItemModel>
#include <QStandardItem>
#include <QDockWidget>

class VariablesViewWidget : public QDockWidget
{
    Q_OBJECT
    Q_ENUMS(EditMode)
public:
    enum EditMode { DEL, RENAME, COPY, VIEW};
public:
    explicit VariablesViewWidget(QWidget *parent = 0);
    ~VariablesViewWidget();    

public slots:
    void viewRefresh(QList<GSData*>* pDataSet);
    void popMenuEditItem(const QPoint &pos); //pop context menu
    void editVariable(int index, EditMode mode);

protected:
//    void closeEvent(QCloseEvent *event);

signals:
    void variablesViewClosing();
    void newDataView(GSData* varData);
    void deleteVariable(int index);
    void duplicateVariable(GSData* pdata);
    void editVariableName(GSData* pdata);

private:
    QTreeView* treeView = NULL; //parent is this
    TreeViewModel* treeViewModel = NULL; //parent is this
    QMenu* popMenu = NULL;
};
#endif // VARIABLESVIEWDIALOG_H
